package service

import (
	sqlc "bgs/db/sqlc"
	"context"
)

// GetStoreSpokesmanPtr 根据用户id和门店id获取门店代言人
func (s *SpokesmanServiceImp) GetStoreSpokesmanPtr(ctx context.Context, q *sqlc.Queries, userID, storeID int64) (spokesmanPtr *sqlc.Spokesman, err error) {
	entity, err := q.GetNormalStoreSpokesmanByUserIDAndStoreID(ctx, sqlc.GetNormalStoreSpokesmanByUserIDAndStoreIDParams{
		UserID:  userID,
		StoreID: sqlc.NInt64FromInt64(storeID),
	})
	if err != nil {
		return
	}
	spokesmanPtr = &entity
	return
}
